// 发布消息
int nb_mqtt_pub(char *topic, char *buf)
{
    int ret;
    int msgLen = strlen(buf);
    char wbuf[1024];
    hex_to_hexStr(buf, msgLen, tmpbuf);
    snprintf(wbuf, sizeof(wbuf), "AT+MQTTPUB=\"%s\",2,1,0,%d,\"%s\"", topic, msgLen, tmpbuf);
    do
    {
        ret=NB_Send_Cmd(wbuf, "OK", 20);
    } while (ret == AT_ERROR);

    return (ret);
}
static void NbExampleEntry(void)
{
    uart8_init(9600);
    printf("NB START!\n");

    osThreadAttr_t attr;
    attr.name = "NB_TASK";
    attr.attr_bits = 0U;
    attr.cb_mem = NULL;
    attr.cb_size = 0U;
    attr.stack_mem = NULL;
    attr.stack_size = 1024 * 4;
    attr.priority = osPriorityNormal;

    if (osThreadNew((osThreadFunc_t)NB_TASK, NULL, &attr) == NULL)
    {
        printf("[GpsExampleEntry] create NB_TASK NG\n");
    }
    else
    {
        printf("[GpsExampleEntry] create NB_TASK OK\n");
    }
}
APP_FEATURE_INIT(NbExampleEntry);